<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>RecordRTC</title>
</head>
<body>
RecordRTC
<script>
    var fileType = 'video'; // or "audio"
    var fileName = 'ABCDEF.webm';  // or "wav"

    var formData = new FormData();
    formData.append(fileType + '-filename', fileName);
    formData.append(fileType + '-blob', blob);

    xhr('save.php', formData, function (fName) {
        window.open(location.href + fName);
    });

    function xhr(url, data, callback) {
        var request = new XMLHttpRequest();
        request.onreadystatechange = function () {
            if (request.readyState == 4 && request.status == 200) {
                callback(location.href + request.responseText);
            }
        };
        request.open('POST', url);
        request.send(data);
    }
</script>
</body>
</html>